#include "head.h"

int net_mkdir(int net_fd, char* file_name, request_t * request)
{
    strcpy(request->args, file_name);

    // 发送请求报文
    int send_size = send(net_fd, request, sizeof(request_t), 0);
    ERROR_CHECK(send_size, -1, "send");

    // 等待响应
    response_t res;
    memset(&res, 0, sizeof(res));
    recv(net_fd, &res, sizeof(res), 0);
    if(res.status == 1){
        // 异常返回
        return -1;
    }
    printf("---响应报文---\n");
    printf("status: %d\n",res.status);
    printf("args: %s\n",res.args);
    printf("-------------\n");

    return 0;
}

